package com.rois.librois.RoIS;

import com.rois.librois.RoIS.ServiceApplicationBase;
import com.rois.librois.RoIS.ServiceApplicationBaseHelper;


/**
* RoIS/ServiceApplicationBasePOA.java .
* IDL-to-Java コンパイラ (ポータブル), バージョン "3.1" で生成
* 生成元: RoIS_IDL.idl
* 2011年9月8日 0時05分18秒 JST
*/


/******************************************
 * For Service Application
******************************************/
public abstract class ServiceApplicationBasePOA extends org.omg.PortableServer.Servant
 implements com.rois.librois.RoIS.ServiceApplicationBaseOperations, org.omg.CORBA.portable.InvokeHandler
{

  // Constructors

  private static java.util.Hashtable _methods = new java.util.Hashtable ();
  static
  {
    _methods.put ("receive_error", new java.lang.Integer (0));
    _methods.put ("completed", new java.lang.Integer (1));
    _methods.put ("receive_event", new java.lang.Integer (2));
  }

  public org.omg.CORBA.portable.OutputStream _invoke (String $method,
                                org.omg.CORBA.portable.InputStream in,
                                org.omg.CORBA.portable.ResponseHandler $rh)
  {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
    if (__method == null)
      throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);

    switch (__method.intValue ())
    {

  /* For System Interface */
       case 0:  // RoIS/ServiceApplicationBase/receive_error
       {
         String error_id = in.read_string ();
         com.rois.librois.RoIS.ErrorType error_type = com.rois.librois.RoIS.ErrorTypeHelper.read (in);
         this.receive_error (error_id, error_type);
         out = $rh.createReply();
         break;
       }


  /* For Command Interface */
       case 1:  // RoIS/ServiceApplicationBase/completed
       {
         String command_id = in.read_string ();
         com.rois.librois.RoIS.Completed_Status status = com.rois.librois.RoIS.Completed_StatusHelper.read (in);
         this.completed (command_id, status);
         out = $rh.createReply();
         break;
       }


  /* For Event Interface */
       case 2:  // RoIS/ServiceApplicationBase/receive_event
       {
         String event_id = in.read_string ();
         String event_type = in.read_string ();
         String subscribe_id = in.read_string ();
         this.receive_event (event_id, event_type, subscribe_id);
         out = $rh.createReply();
         break;
       }

       default:
         throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }

    return out;
  } // _invoke

  // Type-specific CORBA::Object operations
  private static String[] __ids = {
    "IDL:RoIS/ServiceApplicationBase:1.0"};

  public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
  {
    return (String[])__ids.clone ();
  }

  public ServiceApplicationBase _this() 
  {
    return ServiceApplicationBaseHelper.narrow(
    super._this_object());
  }

  public ServiceApplicationBase _this(org.omg.CORBA.ORB orb) 
  {
    return ServiceApplicationBaseHelper.narrow(
    super._this_object(orb));
  }


} // class ServiceApplicationBasePOA
